package com.test.store;

import java.util.HashMap;

public class Store {
    protected static HashMap<Integer, Integer> stock = new HashMap<Integer, Integer>();
    
    public int deliver(int id, int num) {
            Integer i = new Integer(id);
            Integer n = new Integer(num);
            
            Integer curStock = stock.get(i);
            if (curStock==null)
                    stock.put(i,n);
            else
                    stock.put(i,curStock+n);
            
            return stock.get(i);
    }
}
